# import pymongo
import redis
# import pyredis

r = redis.Redis()


#
# # c = pymongo.MongoClient(host="10.0.0.253", port=27017)
# # db = c['stocks']
# # values = db['values']
# #
# # for x in values.find().sort("close", pymongo.DESCENDING).limit(100):
# #     print(x)
# #
# #
# # c.close()
#
#
#
#
# class _HttpClient:
#     _sharedInstance = None
#     def __new__(cls, *args, **kwargs):
#         if cls._sharedInstance is None:
#             cls._sharedInstance = super().__new__(cls, *args, **kwargs)
#
#         return cls._sharedInstance
#
#         # if not hasattr(cls, "sharedInstance"):
#         #     x = super().__new__(cls, *args, **kwargs)
#         #     setattr(cls, "sharedInstance", x)
#         #
#         # return getattr(cls, "sharedInstance")
#
#     def get(self, url):
#         pass
#
#     def post(self, url):
#         pass
#
#
# x1 = _HttpClient()
# x2 = _HttpClient()
# x3 = _HttpClient()
#
# print(x1 is x2, id(x1), id(x2))
# print(x2 is x3, id(x2), id(x3))
#
#
#
#

def m():
    return "abc"

def x(a, flag=0):
    if flag == 2:
        return
    yield a
    yield m()


for y in x("a"):
    print(y)




